/*
 * UnaryAteOperatorAst.cpp
 *
 *  Created on: 1 Nov 2010
 *      Author: ph1109
 */

#include <MAlice/Ast/UnaryAteOperatorAst.h>
#include <MAlice/Ast/IntegerLiteralAst.h>
#include <MAlice/Ast/BinaryAddOperatorAst.h>
#include <MAlice/Ast/AssignmentOperatorAst.h>

namespace MAlice
{

UnaryAteOperatorAst::UnaryAteOperatorAst(VariableAst* lhs) :
	UnaryOperatorAst("ate", lhs)
{
}

UnaryAteOperatorAst::~UnaryAteOperatorAst()
{
}

llvm::Value* UnaryAteOperatorAst::generate()
{
	return AssignmentOperatorAst(reinterpret_cast<VariableAst*> (getLHS()),
			new BinaryAddOperatorAst(getLHS(), new IntegerLiteralAst(1))).generate();
}

}
